package cn.wolfcode.shop.cloud.mq;

import cn.wolfcode.shop.cloud.common.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;

/**
 * Created by wolfcode-lanxw
 */
@Slf4j
public class DefaultSeckillOrderMsgSendCallback implements SendCallback {
    @Override
    public void onSuccess(SendResult sendResult) {
        log.info("[异步下单] 发送消息成功:{}", JSONUtil.toJSONString(sendResult));
    }

    @Override
    public void onException(Throwable e) {
        log.error("[异步下单] 发送消息失败", e);
    }
}
